package com.yingjie.yingjieorder.service.impl;


import com.yingjie.yingjieorder.model.OrderFood;
import com.yingjie.yingjieorder.service.OrderFoodService;
import com.yingjie.yingjieorder.mapper.OrderFoodMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;

/**
* @author Administrator
* @description 针对表【order_food(订单的菜品表)】的数据库操作Service实现
* @createDate 2025-03-09 17:04:40
*/
@Service
public class OrderFoodServiceImpl implements OrderFoodService{

    @Resource
    private OrderFoodMapper orderFoodMapper;
    @Override
    public Integer subimtOrderFoods(ArrayList<OrderFood> orderFoods, Integer orderId, Integer userId) {
        for (OrderFood orderFood : orderFoods) {
            orderFood.setOrderUserId(userId);
            orderFood.setOrderId(orderId);

        }


        return orderFoodMapper.subimtOrderFoods(orderFoods);
    }

    @Override
    public ArrayList<OrderFood> selectOrderFoodsList(Integer orderId) {
        return orderFoodMapper.selectOrderFoodsList();
    }
}




